require 'rexml/document'

class State

  attr_accessor :nameU
  attr_accessor :name

  def initialize( xml_doc )

		if nil != xml_doc.attributes["NameU"]
			@nameU = xml_doc.attributes["NameU"]
		else
			@nameU = "State/ Region." << xml_doc.attributes["ID"]
		end

    xml_doc.elements["Shapes"].each { |element|
      case element.attributes["MasterShape"]
        when "8" 
          @name = element.elements["Text"].text
      end
    }

  end

end


